import requests
#L946的机器人
# DINGTALK_WEBHOOK = 'https://oapi.dingtalk.com/robot/send?access_token=3ca7b55b692672affb7a9673640e5c9273e4c0704cfda1a5ddc9d203a61fd3b1'
#性能通知群的机器人
DINGTALK_WEBHOOK = 'https://oapi.dingtalk.com/robot/send?access_token=56666553b64d1b522c708287c48b408effbff881813fa0702e8192a0933ec1ad'

def send_dingtalk_message(title):
    headers = {'Content-Type': 'application/json'}

    message={
     "msgtype": "markdown",
     "markdown": {
         "title": "测试报告",
        "text": (
                f"### L946性能测试\n\n"
                f"## **内容:** {title} @17816121899\n\n"
            )},
      "at": {
          "atMobiles": [
              "17816121899"
          ],
          "atUserIds": [
              "xvjiye"
          ],
          "isAtAll": False
      }
 }
    requests.post(DINGTALK_WEBHOOK, json=message, headers=headers)

if __name__=="__main__":
    send_dingtalk_message("测试")